package com.sojoys.artifact.tools;

import java.util.concurrent.locks.ReentrantLock;

public class LoadDatabaseStatus {
		private volatile boolean load = false;
		
		public LoadDatabaseStatus(boolean load) {
			super();
			this.load = load;
		}

		public boolean isLoad() {
			return load;
		}

		public ReentrantLock loadBegin(ReentrantLock lock,boolean loadAll) {
			if (!load && !loadAll) {
				lock.lock();
				return lock;
			}
			return null;
		}

		public void loadSucceed(){
			load = true;
		}
	}